import axios from 'axios'
axios.defaults.withCredentials = true

// 用户登录注册模块
// let base='http://192.168.96.105:8080'
let base = 'https://192.168.96.105:8083'

// 账号密码登录
export const AccountLogin = params => { return axios.post(`${base}/api/no_token/userlogin`, params).then(res => res.data); };
// 注册获取验证码
export const GetCode = params => { return axios.post(`${base}/api/no_token/phone_code`, params).then(res => res.data); };
// 注册方法
export const userReg = params => { return axios.post(`${base}/api/no_token/userregist_phone`, params).then(res => res.data); };
// 验证码登录获取验证码
export const userLogCode = params => { return axios.post(`${base}/api/no_token/phone_code_public`, params).then(res => res.data); };
// 验证码登录方法
export const userCodeLog = params => {
    return axios.post(`${base}/api/no_token/userlogin_phone`, params, {
        timeout: 60000
    }).then(res => res.data);
};
// 获取用户信息
export const getUserInfo = params => { return axios.post(`${base}/api/no_page/user`, params, { headers: { 'token': window.localStorage.getItem('token') } }).then(res => res.data); };


// 文件模块
// let base1='http://192.168.96.105:6063'
// let base2='http://192.168.96.105:9090'
let base1 = 'https://192.168.96.105:6064'
let base2 = 'https://192.168.96.105:9091'

// 云盘文件的增删改查
export const FileOption = params => { return axios.post(`${base2}/documentation/no_token/disk.action`, params).then(res => res.data); };
// 上传文件之前先调用上传文件的登录
export const FileLogin = params => { return axios.post(`${base1}/documentation/user/login`, params).then(res => res.data); };
// 读取一个文件的转换文件
export const FileConvert = params => { return axios.post(`${base2}/documentation/no_token/file_convert`, params).then(res => res.data); };

// 房间模块
let base3 = 'https://192.168.30.25:8899'
// 获取房间号
export const getRoom = params => { return axios.post(`${base3}/api/v2/conference/rooms`, params).then(res => res.data); };


